package com.kaka.bus.view.dialog;

import android.content.Context;
import android.support.annotation.NonNull;

/**
 * Created by OnionMac on 2018/4/3.
 */

public class TempletDialog extends BaseDialog {

    private Builder mBuilder;

    public TempletDialog(@NonNull Context context,Builder builder) {
        super(context);
        mBuilder = builder;
    }

    @Override
    protected int getLayoutId() {
        return mBuilder.layoutRes;
    }

    @Override
    protected int getWindowAnim() {
        return mBuilder.windowAnim;
    }

    @Override
    protected void initView() {

    }

    @Override
    protected int moveY() {
        return mBuilder.moveY;
    }

    @Override
    protected double getWidthPer() {
        return mBuilder.widthPer;
    }

    public static class Builder {
        public int layoutRes;
        public double widthPer;
        public Context mContext;
        public int windowAnim;
        public int moveY;
        public Builder(Context context){
            mContext = context;
        }

        public Builder setLayout(int layoutRes){
            this.layoutRes = layoutRes;
            return this;
        }

        public Builder setWidthPer(double widthPer){
            this.widthPer = widthPer;
            return this;
        }

        public Builder setWindowAnim(int windowAnim){
            this.windowAnim = windowAnim;
            return this;
        }

        public Builder setMoveY(int moveY){
            this.moveY = moveY;
            return this;
        }

        public TempletDialog build(){
            TempletDialog templetDialog = new TempletDialog(mContext,this);
            return templetDialog;
        }
    }
}
